<template>
  <div>
    <div>
      <p1>
        正在进行的工单
      </p1>
    </div>
    <el-table :data="tableData" style="width: 100%">
      <!-- 图片列 -->
      <el-table-column label="问题图片" width="100">
        <template slot-scope="scope">
          <el-image
            style="width: 100px; height: 100px"
            :src="scope.row.imageUrl"
            :preview-src-list="[scope.row.imageUrl]"
          ></el-image>
        </template>
      </el-table-column>

      <!-- 工单号列 -->
      <el-table-column prop="orderNo" label="工单号"></el-table-column>

      <!-- 工单类型列 -->
      <el-table-column prop="workOrderType" label="工单类型"></el-table-column>

      <!-- 工单状态列 -->
      <el-table-column prop="workOrderStatus" label="工单状态"></el-table-column>

      <!-- 创建时间列 -->
      <el-table-column prop="workOrderCreateTime" label="创建时间"></el-table-column>

      <!-- 问题描述列 -->
      <el-table-column prop="workOrderDescription" label="问题描述"></el-table-column>

    </el-table>
  </div>
</template>

<script>
export default {
  name: "BookCity",
  data() {
    return {
      tableData: [], // 初始化为数组
    };
  },
  methods: {
    BookRemoval() {
      this.$http.post('/tWorkOrder/OrderInProgress')
      .then(response => {
        // 将返回的对象包装到数组中
        this.tableData = [response.data.data];
      })
      .catch(error => {
        console.error('获取数据失败:', error);
      });
    }
  },
  created() {
    this.BookRemoval();
  }
}
</script>
